package com.megagoodsoftware.MediaShare;

import android.content.Intent;
import android.os.Bundle;

import com.megagoodsoftware.smugmug.SmugMugAlbum;

public class SmugMugBundleHelper {
    public static final String EXTRA_ALBUM = "com.megagoodsoftware.MediaShare.extra_album";
	public static final String EXTRA_USER = "com.megagoodsoftware.MediaShare.extra_user";

	public static String getAlbumFromBundle(Intent intent) {
        
        final Bundle extras = intent.getExtras();
        if (extras != null) {
            return extras.getString(EXTRA_ALBUM);
        }
		return null;
	}

	/**
     * Creates a {@link com.google.android.photostream.Flickr.User} instance
     * from the intent used to start this activity.
     *
     * @return The user whose photos will be displayed, or null if no
     *         user was found.
     */
    public static User getUserFromBundle(Intent intent) {
//        final String action = intent.getAction();

        User user = null;

//        if (ACTION.equals(action)) {
            final Bundle extras = intent.getExtras();
            if (extras != null) {
                user = extras.getParcelable(EXTRA_USER);

//                if (user == null) {
//                    final String nsid = extras.getString(EXTRA_NSID);
//                    if (nsid != null) {
//                        user = User.fromId(nsid);
//                    }
//                }
            }
//        } else if (Intent.ACTION_VIEW.equals(action)) {
//            final List<String> segments = intent.getData().getPathSegments();
//            if (segments.size() > 1) {
//                mUsername = segments.get(1);
//            }
//        }

        return user;
    }

}
